const { GameServer } = require('board-game');
const { server } = require('./config');

const MazeRole = require('./role');
const MazeGroup = require('./group');
const MazeBoard = require('./board');
const MazeGame = require('./game');

GameServer.start({
    moveStart: ({ role, data } ) => role.moveStart(data),
    moveEnd: ({ role, data } ) => role.moveEnd(data),
}, {
    Board: MazeBoard,
    Role: MazeRole,
    Group: MazeGroup,
    Game: MazeGame,
}, server, {
    index: './web/index.js',
    compress: process.env.NODE_ENV !== 'development',
    watch: process.env.NODE_ENV === 'development',
    stats: 'verbose',
    devtools: process.env.NODE_ENV === 'development'
});
